import java.util.Arrays;

public class Text3 {
    public static void main(String[] args) {
        //字符串拆分
        String str="hello world hello bit";
        String[] ret=str.split(" ");
        System.out.println(Arrays.toString(ret));
        for (int i = 0; i < ret.length; i++) {
            System.out.println(ret[i]);
        }
        System.out.println("-------------");
        String[] ret2=str.split(" ",2);
        for (int j = 0; j < ret2.length; j++) {
            System.out.println(ret2[j]);
        }
    }
}
